<div class="card-head"><h4>用户管理</h4></div>
<div class="card-block bg-white">
  <div class="block">
    <div class="box" style="margin-top: 1.25rem">
      <div class="box-body no-padding">
        <table class="table table-striped">
          <tr>
            <th>账户</th>
            <th>用户名</th>
            <th>状态</th>
            <th>角色</th>
            <th>操作</th>
          </tr>
          <tr *ngFor="let p of accountList">
            <td *ngIf="p.code!='admin'">{{p.code}}</td>
            <td *ngIf="p.code!='admin'">{{p.name}}</td>
            <td *ngIf="p.code!='admin'">
              <div class="label label-warning" *ngIf="p.statusName=='禁用'">{{p.statusName}}</div>
              <div class="label label-info" *ngIf="p.statusName=='启用'">{{p.statusName}}</div>
            </td>
            <td *ngIf="p.code!='admin'">{{p.roles.length==0?'':p.roles[0].name}}</td>
            <td *ngIf="p.code!='admin'">
              <a href="javascript:;" (click)="closeAccount(p.code)">禁用</a>|
              <a href="javascript:;" (click)="ActiveAccount(p.code)">启用</a>|
              <a href="javascript:;" (click)="showRoleDialog(p.code)">角色修改</a>
            </td>
          </tr>
        </table>
      </div>
    </div>
  </div>
  <div style="border-bottom: 1px solid #E5E5E5;margin-top: 1.25rem;margin-bottom:1.25rem"></div>
  <p-dialog [(visible)]="showRoleFlag" [positionTop]="180" [modal]="true" [responsive]="true" [width]="200" [minWidth]="50" [minY]="70">
    <div class="form-group has-feedback" style="text-align: center;">
      <select [(ngModel)]="currentRoleCode" style="width: 100%;">
        <option *ngFor="let p of roles" value="{{p.code}}">{{p.name}}</option>
      </select>
    </div>
    <p-footer>
      <div style="text-align: center;">
        <button (click)="updateRole()" type="submit" class="btn btn-sm btn-info">确认修改</button>
      </div>
    </p-footer>
  </p-dialog>
</div>



